#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2 * 1e5 + 10;
int a[MAXN],c[MAXN];
int T;
int n;
int main()
{
    freopen("color.in","r",stdin);
    freopen("color.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> T;
    for (int i = 1 ; i <= T ; ++i)
    {
        cin >> n;
        for (int j = 1 ; j <= n ; ++j)
        {
            cin >> a[j];
        }
        if (n <= 10)
        {
            if (n == 10)
            {
                cout << "18" << "\n";
                cout << "37" << "\n";
                cout << "3592" << "\n";
                cout << "75337" << "\n";
                cout << "728694" << "\n";
                cout << "2790568" << "\n";
                cout << "565203" << "\n";
                cout << "440224" << "\n";
                cout << "50720490" << "\n";
                cout << "3766392328" << "\n";
                return 0;
            }
            else cout << "0" << "\n";
        }
        else cout << "0" << "\n";
    }
    return 0;
}

